<template>
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
      </a-table>
    </div>
</template>

<script>
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import { filterMultiDictText, initDictOptions } from '@/components/dict/JDictSelectUtil'

export default {
    name: "TaskNotifyMeList",
    props: ['procInstId'],
    mixins:[JeecgListMixin],
    components: {
    },
    data () {
      return {
        description: '提醒我的',
        disableMixinCreated: true,
        queryParam:{},
        // 表头
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
          {
            title: '流程名称',
            align:"center",
            dataIndex: 'procName',
            width:120,
          },
		      {
            title: '任务名称',
            align:"center",
            dataIndex: 'taskName',
            width:100,
           },
           {
              title: '催办人',
              align:"center",
              dataIndex: 'createBy',
              width:100,
              customRender: (text) => {
                if (!text) {
                  return ''
                } else {
                  return filterMultiDictText(this.dictOptions['username'], text + '')
                }
              }
            },
          {
                title: '催办时间',
                align:"center",
                dataIndex: 'opTime',
                width:130,
              },
		   {
            title: '催办类型',
            align:"center",
            width:160,
            dataIndex: 'notifyType',
         customRender:function (text) {
           var srtArr = text.split(',');
           var value = "";
           if (srtArr.includes("1")) {
             value +=",系统消息"
           }
           if (srtArr.includes("2")) {
             value +=",邮件"
           }
           if (srtArr.includes("3")) {
             value +=",APP消息提醒"
           }
           return value.substring(1);
         }
           },
		   {
            title: '催办说明',
            align:"center",
            width:200,
            dataIndex: 'remarks',
            ellipsis: true,
           }
        ],
		url: {
          list: "/api/erpmng/act/process/extActTaskNotification/list",
       },
       dictOptions:{}
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    created() {
      //此处特殊，需要带参数查询数据，所以重新调用loadData()方法
      this.queryParam.procInstId = this.procInstId;
      console.log('this.procInstId',this.procInstId);
      this.loadData();
      //初始化字典配置 在自己页面定义
      this.initDictConfig();
    },
    methods: {
      initDictConfig() {
        initDictOptions('sys_user,realname,username').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'username', res.result)
          }
        })
        
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>